package com.broada.apm.entity;

import com.broada.apm.cache.AreaManager;
import com.broada.apm.model.Dimension.Area;
import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * Ip地理位置
 * 
 * { id: uuid, earaCode: '000001', startIp: 192.168.0.2, startIpNum:1232,
 * endIp:192.168.0.255, endIpNum:23121, memo: ""
 * 
 * @author louyi Create By 2014年11月21日 下午3:59:42
 */
public class IPLocation {

	
	public int getPageIndex(){
		return raw.getPageIndex();
	}
	public void setPageIndex(int pageIndex){
		raw.setPageIndex(pageIndex);
	}
	public int getPageSize(){
		return raw.getPageSize();
	}
	public void setPageSize(int pageSize){
		raw.setPageSize(pageSize);
	}
	
	public String getId() {
		return raw.getId();
	}
	public void setId(String id) {
		raw.setId(id);
	}
	public String getAreaCode() {
		return raw.getAreaCode();
	}
	public void setAreaCode(String areaCode) {
		raw.setAreaCode(areaCode);
	}
	public String getStartIp() {
		return raw.getStartIp();
	}
	public void setStartIp(String startIp) {
		raw.setStartIp(startIp);
	}
	public String getEndIp() {
		return raw.getEndIp();
	}
	public void setEndIp(String endIp) {
		raw.setEndIp(endIp);
	}
	public long getStartIpNum() {
		return raw.getStartIpNum();
	}
	public void setStartIpNum(long startIpNum) {
		raw.setStartIpNum(startIpNum);
	}
	public long getEndIpNum() {
		return raw.getEndIpNum();
	}
	public void setEndIpNum(long endIpNum) {
		raw.setEndIpNum(endIpNum);
	}
	public String getMemo() {
		return raw.getMemo();
	}
	public void setMemo(String memo) {
		raw.setMemo(memo);
	}

	private com.broada.apm.model.IPLocation raw = null;
	public IPLocation() {
		raw = new com.broada.apm.model.IPLocation();
	}
	public static IPLocation wrap(com.broada.apm.model.IPLocation ipLocation) {
		IPLocation ipLocation2 = new IPLocation();
		ipLocation2.raw = ipLocation;
		return ipLocation2;
	}
	public com.broada.apm.model.IPLocation unwrap(){
		return raw;
	}

	@JsonIgnore
	public String getAreaName() {
		return AreaManager.getInstance().getAreaFullNameByCode(getAreaCode());
	}
	
	@JsonIgnore
	public Area[] getArea() {
		return AreaManager.getInstance().parseAreaByCode(getAreaCode());
	}
}
